package com.hourses.mapper;

import com.hourses.page.Page;
import com.hourses.pojo.InStore;
import com.hourses.pojo.Purchase;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface PurchaseMapper {

    //向buy_list表中插入数据
    public Integer addBuyList(Purchase purchase);

    //查询采购单
    //查询满足条件的采购单总共有多少
    public Integer selectPurchasesCount(Purchase purchase);

    //查询当前页需要展示的采购列表
    public List<Purchase> selectPurchases(@Param("purchase")Purchase purchase,@Param("page") Page page);

    //删除采购单
    public Integer deleteBuyList(Integer buyId);

    //修改采购单
    public Integer updateBuyList(Purchase purchase);

    //修改buyList表中的isIn字段
    public Integer updateIsIn(Integer inStore);
}